import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class SwingConsole {
  public static void
  run(final JFrame f, final int width, final int height, final int shiftx, final int shifty) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        f.setTitle(f.getClass().getSimpleName());
//        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setSize(width, height);
        f.setVisible(true);
        f.setBounds(new java.awt.Rectangle(shiftx, shifty, width, height));
      }
    });
  }
}
